//  this library.
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
import 'package:hktk_app/widget/question/image_view_widget.dart';



class HotShareHtml extends StatefulWidget {
  String content;

  HotShareHtml({Key? key, required String content})
      : content = content,
        super(key: key);

  @override
  State<StatefulWidget> createState() => _createHotShareState();
}

class _createHotShareState extends State<HotShareHtml> {
  @override
  Widget build(BuildContext context) {
    // 
    return MaterialApp(
        theme: _lightTheme(),
        home: Scaffold(
            body: SafeArea(

                child: HtmlWidget(
                  "<span class=\"overlayGradient\" style=\"color:red\">2222222</span>",
                  // "\<html\>\<body style='color\:red;'\>1111111\</body\>\</body\>\<\/html\>",
                  customWidgetBuilder: (element) {
                    if (element.localName == "img") {
                      var src = element.attributes["src"];
                      return ImageViewWidget(src: src!);
                    }
                    return null;
                  },
                ))));
  }

  _lightTheme() {
    return ThemeData(
      brightness: Brightness.light,
      colorScheme: ColorScheme.fromSeed(seedColor: Color(0xFF6200EE)),
      useMaterial3: true,
      // 全局字体
      fontFamily: "PingFangSc",
    );
  }
}
